home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 201 / DPCS1104.ISO / Full / QuickBooks / QBTutor / Lesson2 / Lesson2.dcr / 00142_click New Cust button OK.ls < prev    next >
Encoding:
Text File  |  2001-11-19  |  856 b   |  42 lines

  1. property PropTarget, buttonReady
  2. global firstTimeNewCustomer
  3.  
  4. on getPropertyDescriptionList
  5.   description = [:]
  6.   addProp(description, #PropTarget, [#default: EMPTY, #format: #string, #comment: "First Time Target:"])
  7.   return description
  8. end
  9.  
  10. on mouseEnter me
  11.   buttonReady = 0
  12. end
  13.  
  14. on mouseLeave me
  15.   buttonReady = 0
  16. end
  17.  
  18. on mouseDown me
  19.   buttonReady = 1
  20. end
  21.  
  22. on mouseUp me
  23.   if buttonReady > 0 then
  24.     if (firstTimeNewCustomer = "TRUE") and (PropTarget <> "{save}") then
  25.       if PropTarget <> EMPTY then
  26.         go(PropTarget)
  27.       end if
  28.     else
  29.       if member("field:Customer").text <> EMPTY then
  30.         saveNewCustomer()
  31.         writeCustomerListData()
  32.         if firstTimeNewCustomer = "TRUE" then
  33.           go("pre-Add to List")
  34.         else
  35.           go("Closebox fast")
  36.         end if
  37.       end if
  38.     end if
  39.   end if
  40.   buttonReady = 0
  41. end
  42.